// JS Code
// 下拉框的js操作代码
function Tab(){
	// 获取id为selected的对象
	var selected = document.getElementById('select');
	// 取得被选定项并保存在index变量中 
	var index = selected.selectedIndex;
	var value = selected.options[index].value;

	var option_array = document.getElementsByTagName("option");
	// alert(option_array[2].href);
	if (value == 1) {
		location = "admin_index.php?f=add";
	} else if (value == 2) {
		location = "admin_index.php?f=revise";
	} else if(value == 3){
		location = "admin_index.php?f=delete";
	} else if(value == 4){
		location = "admin_index.php?f=view";
	} else if(value == 5){
		location = "admin_index.php?f=view_order";
	}  else {
		// 不做任何操作！！！
	}
}

// 表格的js代码
var Ptr=document.getElementById("tab").getElementsByTagName("tr");
function $() {
    for (i=1;i<Ptr.length+1;i++) { 
    Ptr[i-1].style.backgroundColor = (i%2>0)?"#fff":"#eee"; 
    }
}
window.onload=$;
for(var i=0;i<Ptr.length;i++) {
    Ptr[i].onmouseover=function(){
    this.tmpClass=this.className;
    this.style.backgroundColor = "#ccc";
    
    };
    Ptr[i].onmouseout=function(){
    for (i=1;i<Ptr.length+1;i++) { 
    Ptr[i-1].style.backgroundColor = (i%2>0)?"#eee":"#fff"; 
    }
	}
}


//function Tab() {
//	// 获取id为selected的对象
//	var selected = document.getElementById('select');
//	// 取得被选定项并保存在index变量中 
//	var index = selected.selectedIndex;
//	var url = selected.options[index].value;

//	var option_array = document.getElementsByTagName("option");
//	alert(index);
//	window.open(url,"_self");

//	// location = url;
//}

